package com.vector.demo.service.impl;

import com.vector.demo.mapper.GradeMapper;
import com.vector.demo.pojo.Grade;
import com.vector.demo.pojo.QueryGradeInfo;
import com.vector.demo.pojo.QueryJiyiGrade;
import com.vector.demo.service.GradeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GradeServiceImpl implements GradeService {
    @Autowired
    private GradeMapper gradeMapper;

    /**
     * 查询成绩信息
     * @return
     */
    @Override
    public List<QueryGradeInfo> queryAllGrade() {
        return gradeMapper.queryAllGrade();
    }

    /**
     * 根据 ID 查询成绩信息
     * @return
     */
    @Override
    public QueryGradeInfo queryByIdGrade(int id) {
        return gradeMapper.queryByIdGrade(id);
    }

    @Override
    public List<QueryJiyiGrade> queryJiyiGrade() {
        return gradeMapper.queryJiyiGrade();
    }

    @Override
    public int queryEachGrade(int id) {
        return gradeMapper.queryEachGrade(id);
    }

    /**
     * 根据 ID 修改成绩信息
     * @return
     */
    @Override
    public void modifyByIdGrade(int id, double grade) {
        gradeMapper.modifyByIdGrade(id, grade);
    }

}
